<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    ul {
      width: 500px;
      margin: auto;
      list-style: none;
      padding: 0;
      border: 1px solid red;
      text-align: center;
    }

    li+li {
      border-top: 1px solid blue;
    }
    /* li {
      border: 1px solid blue;
      border-bottom: 0px solid blue;
    }
    li:last-child{
        border-bottom: 1px solid blue;  
    } */
  </style>
</head>

<body>
  <ul>
    <li>1</li>
    <li>2</li>
    <li>3</li>
    <li>4</li>
    <li>5</li>
    <li>6</li>
  </ul>
</body>

</html>